package com.codeduck.bean.entity;

import lombok.extern.slf4j.Slf4j;

/**
 * Bean的生命周期之初始化与销毁方法
 *
 * 向 Spring 注册 BeanLifeCycleI : {@link com.codeduck.bean.config.BeanLifeCycleConfigI}
 *
 * @author: <a href="mailto:codeduck@163.com">Codeduck</a>
 * @since: 2021-12-23
 */
@Slf4j
public class BeanLifeCycleI {

    private String name;

    public BeanLifeCycleI() {
        log.warn("bean的构造方法调用完毕");
    }

    public void setName() {
        this.name = "name";
        log.warn("bean#setName 方法调用完毕");
    }

    public void init() {
        log.warn("@Bean#initMethod 方法调用完毕");
    }

    public void  destroy() {
        log.warn("@Bean#destroyMethod 方法调用完毕");
    }
}
